<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get time currently represented by the object</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.getskippedwalltimeoption.html">IntlCalendar::getSkippedWallTimeOption</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.gettimezone.html">IntlCalendar::getTimeZone</a></div>
 <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="intlcalendar.gettime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">IntlCalendar::getTime</h1>
  <p class="verinfo">(PHP 5.5.0, PECL &gt;= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::getTime</span> &mdash; <span class="dc-title">Get time currently represented by the object</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-intlcalendar.gettime-description">
  <h3 class="title">说明</h3>
  <p class="para">
   面向对象风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">float</span> <span class="methodname"><strong>IntlCalendar::getTime</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   过程化风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="type">float</span> <span class="methodname"><strong>intlcal_get_time</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.intlcalendar.html" class="type IntlCalendar">IntlCalendar</a></span> <code class="parameter">$cal</code></span>
   )</div>

  <p class="para rdfs-comment">
   Returns the time associated with this object, expressed as the number of
   milliseconds since the epoch.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-intlcalendar.gettime-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">cal</code></em></dt>

    <dd>

     <p class="para">
      The IntlCalendar resource.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-intlcalendar.gettime-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   A <span class="type"><a href="language.types.float.html" class="type float">float</a></span> representing the number of milliseconds elapsed since the
   reference time (1 Jan 1970 00:00:00 UTC).
  </p>
 </div>



 <div class="refsect1 examples" id="refsect1-intlcalendar.gettime-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2547">
   <p><strong>Example #1 <span class="function"><strong>IntlCalendar::getTime()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'date.timezone'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'Europe/Lisbon'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'intl.default_locale'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'en_US'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$cal&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">IntlGregorianCalendar</span><span style="color: #007700">(</span><span style="color: #0000BB">2013</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">4&nbsp;</span><span style="color: #FF8000">/*&nbsp;May&nbsp;*/</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$time&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTime</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$time</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$time&nbsp;</span><span style="color: #007700">/&nbsp;</span><span style="color: #0000BB">1000&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">'2013-05-01&nbsp;00:00:00'</span><span style="color: #007700">));&nbsp;</span><span style="color: #FF8000">//true</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
float(1367362800000)
bool(true)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-intlcalendar.gettime-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="intlcalendar.getnow.html" class="methodname" rel="rdfs-seeAlso">IntlCalendar::getNow()</a> - Get number representing the current time</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.getskippedwalltimeoption.html">IntlCalendar::getSkippedWallTimeOption</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.gettimezone.html">IntlCalendar::getTimeZone</a></div>
 <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
